package com.ruoyi.legal.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruoyi.common.core.page.Pages;
import com.ruoyi.common.core.page.Query;
import com.ruoyi.common.query.QueryTool;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.legal.mapper.PackXjclMapper;
import com.ruoyi.legal.domain.PackXjcl;
import com.ruoyi.legal.service.IPackXjclService;

/**
 * 虚假材料备份Service业务层处理
 * 
 * @author xwj
 * @date 2025-06-05
 */
@Service
public class PackXjclServiceImpl extends ServiceImpl<PackXjclMapper, PackXjcl> implements IPackXjclService {
    @Autowired
    private PackXjclMapper packXjclMapper;

    /**
     * 查询虚假材料备份
     * 
     * @param id 虚假材料备份主键
     * @return 虚假材料备份
     */
    @Override
    public PackXjcl selectPackXjclById(Long id) {
        return packXjclMapper.selectPackXjclById(id);
    }

    /**
     * 查询虚假材料备份列表
     * 
     * @param packXjcl 虚假材料备份
     * @return 虚假材料备份
     */
    @Override
    public List<PackXjcl> selectPackXjclList(PackXjcl packXjcl) {
        return packXjclMapper.selectPackXjclList(packXjcl);
    }

    /**
     * 新增虚假材料备份
     * 
     * @param packXjcl 虚假材料备份
     * @return 结果
     */
    @Override
    public PackXjcl insertPackXjcl(PackXjcl packXjcl) {

      //  packXjclMapper.insertPackXjcl(packXjcl);
    save(packXjcl);
    return packXjcl;
    }

    /**
     * 修改虚假材料备份
     * 
     * @param packXjcl 虚假材料备份
     * @return 结果
     */
    @Override
    public PackXjcl updatePackXjcl(PackXjcl packXjcl) {

      //  packXjclMapper.updatePackXjcl(packXjcl);
        updateById(packXjcl);
        return packXjcl;
    }

    /**
     * 批量删除虚假材料备份
     * 
     * @param ids 需要删除的虚假材料备份主键
     * @return 结果
     */
    @Override
    public int deletePackXjclByIds(Long[] ids) {
        return packXjclMapper.deletePackXjclByIds(ids);
    }

    /**
    * 条件删除
    * @param packXjcl 虚假材料备份
    * @return
    */
    @Override
    public int delete(PackXjcl packXjcl) {
        QueryWrapper<PackXjcl> qw = new QueryWrapper<>();
        QueryTool.condition(qw, packXjcl);
        return baseMapper.delete(qw);
    }

    /**
     * mp分页
     * @param packXjcl 虚假材料备份
     * @return
     */
    @Override
    public Pages<PackXjcl> queryPage(PackXjcl packXjcl) {
        QueryWrapper<PackXjcl> qw = new QueryWrapper<>();
        QueryTool.condition(qw, packXjcl);
        IPage<PackXjcl> ipage = new Query<PackXjcl>().getPage(packXjcl);

        IPage<PackXjcl> page = this.page(
                ipage,
                qw
        );
        return new Pages<>(page);
    }

    @Override
    public void deleteByPackIds(Long[] ids) {
        packXjclMapper.deleteByPackIds(ids);
    }

    /**
     * 删除虚假材料备份信息
     * 
     * @param id 虚假材料备份主键
     * @return 结果
     */
    @Override
    public int deletePackXjclById(Long id) {
        return packXjclMapper.deletePackXjclById(id);
    }
}
